package cool.taomu.demo

import cool.taomu.lang.Runnable
import java.io.ByteArrayInputStream
import java.io.File
import java.io.FileOutputStream
import org.apache.commons.io.IOUtils
import org.jsoup.Connection.Method
import org.jsoup.Jsoup

class TaskDemo implements Runnable{
		String url;	

		new(String url){
			this.url = url;
			// http://quotes.money.163.com/service/chddata.html?code=1000001&start=20220101&end=20220131
		}

		override run() {
			var connect = Jsoup.connect(this.url);
			var respone = connect.maxBodySize(50000000).method(Method.GET).ignoreContentType(true).execute();
			var bytes  = respone.bodyAsBytes;
			IOUtils.copy(new ByteArrayInputStream(bytes),new FileOutputStream(new File("")));
		}












}